#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START openssl1.1
# depends: zlib

# Note: OpenSSL does not use autocrap
rm -rf build/openssl1.1
mkdir -p build/openssl1.1
cd build/openssl1.1

env \
	CROSS_COMPILE="${TARGET}-" \
	CFLAGS="$CFLAGS" \
	CPPFLAGS="$CPPFLAGS" \
	LDFLAGS="$LDFLAGS" \
../../openssl1.1/Configure \
	--prefix=$prefix \
	--libdir=${target_libdir} \
	--openssldir=/etc/openssl \
	--system-ciphers-file=/etc/openssl/cipher-list.conf \
	enable-egd \
	enable-md2 \
	enable-rfc3779 \
	enable-ssl3 \
	zlib \
	linux-generic64 \
	no-tests \
	${NIL}

make -j${JOBS}
make -j${JOBS} install DESTDIR=`pwd`/inst
# nuke manpages
rm -rf inst${prefix}/share
rsync -avH ./inst/ "${stage}/"
cd ../..

# RECIPE END openssl1.1
